package com.cnhis.cloudhealth.clidoctorweb.gzip;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;

public class MyResponseWrapper extends HttpServletResponseWrapper {
    private MyWriter myWriter;
    private MyOutputStream myOutputStream;  
    
    public MyResponseWrapper(HttpServletResponse response) {
        super(response);
    }
    
    @Override
    public PrintWriter getWriter() throws IOException {
        myWriter = new MyWriter(super.getWriter());
        return myWriter;
    }
    
    

    public MyWriter getMyWriter() {
        return myWriter;
    }
    
    
   @Override  
   public ServletOutputStream getOutputStream() throws IOException {  
       myOutputStream = new MyOutputStream(super.getOutputStream());  
       return myOutputStream;  
   }  
  
 
   public MyOutputStream getMyOutputStream() {  
       return myOutputStream;  
   }  

    
    
}